<script setup name="App" lang="ts">
import { ref } from 'vue';
import Child from './Child.vue';

const username = ref('吕布')
const money = ref(100)

// !需求：儿子修改父亲的 username 和 money

const updateMoney = (m: number) => {
  money.value += m
}

const updateUsername = (s: string) => {
  username.value = s
}
</script>
<template>
  <div>
    App
    <hr/>
    <Child :username="username" :money="money" @update-money="updateMoney" @update-username="updateUsername"/>
  </div>
</template>
